import unittest,requests
class weidu(unittest.TestCase):
    # host="https://10.59.9.18/"
    # userId=None
    # sessionId=None
    # 
    # 
    # # 登陆
    # def test_01(self):
    #     url=weidu.host+"/techApi/user/v1/login"
    #     json={'phone':'15136595213','pwd':'UGJYakExdExTMERUbHlkc2lMd3NvK3Y2OHNMZ1l3cDhteldpRTJoREpOZTBKSlFRYmVnOWdNNXpWY2pTOG1vS29JRytqK0g5bldRUUcyZ3VoUHlmT2lLRVgvazRRK3ZIclUvNmhGMkpYV0YwNStyNVdpUXdieXRqdnpxQ1VUZDQ4Um1RYTRMdVJOU0ZxeC8wOWE3Y3poNXE1a1htZEs3RlBKUkNqU1NHcU9FPQ=='}
    #     r=requests.post(url=url,data=json,verify=False)
    #     print(r.json())
    #     weidu.userId=str(r.json()['result']['userId'])
    #     weidu.sessionId = r.json()['result']['sessionId']
    #     print(weidu.userId)
    #     print(weidu.sessionId)

    host = 'https://10.59.9.18/'
    # login 登录
    userId = None
    sessionId = None

    def test_01_login(self):
        url = weidu.host + '/techApi/user/v1/login'
        json = {'phone': '15136595213',
                'pwd': 'UGJYakExdExTMERUbHlkc2lMd3NvK3Y2OHNMZ1l3cDhteldpRTJoREpOZTBKSlFRYmVnOWdNNXpWY2pTOG1vS29JRytqK0g5bldRUUcyZ3VoUHlmT2lLRVgvazRRK3ZIclUvNmhGMkpYV0YwNStyNVdpUXdieXRqdnpxQ1VUZDQ4Um1RYTRMdVJOU0ZxeC8wOWE3Y3poNXE1a1htZEs3RlBKUkNqU1NHcU9FPQ=='}
        login = requests.post(url=url, data=json, verify=False)
        print(login.json())
        weidu.userId = login.json()['result']['userId']
        weidu.sessionId = login.json()['result']['sessionId']
        self.assertEqual('649', weidu.userId)
        self.assertFalse(weidu.userId == '666')
if __name__ == '__main__':
    unittest.main()